const app = getApp();

Page({

 
  data: {
    users: []
  },

  
  onLoad: function (options) {
    getAllUsers(this);
  },

 
  onReady: function () {

  },

  authentication: function(e){
    var _this = this;
    wx.request({
      url: 'https://dorm.dormassistant.wang:8080/manager/authenticatio',
      method: "POST",
      data: {
        userId: e.currentTarget.id
      },
      header: {
        'Content-Type': 'application/x-www-form-urlencoded;charset=utf8'
      },
      success: function (res) {
        _this.onLoad();
      }
    });

  }
 
})

const getAllUsers = function(_this){

  wx.request({
    url: 'https://dorm.dormassistant.wang:8080/userInformation/queryAllUserInformation',
    method: "GET",
    data: {

    },
    success: function (res) {
      _this.setData({
        users: res.data.users
      });
      console.log(_this.data.users);
    }
  });

}